<template>
	<div>
		<form @submit.prevent>
			<List border item-layout="vertical">
				<ListItem>
					<ListItemMeta title="商户支付证书序列号" />
					<template #action>
						<li style="width: 100%;">
							<Input v-model="setting.zsxlh" placeholder="请输入商户支付证书序列号" />
						</li>
					</template>
				</ListItem>
				<!-- <ListItem>
					<ListItemMeta title="商户支付证书序列号" />
					<template #action>
						<li>
							<Input v-model="setting.zsxlh" style="width: 350px" placeholder="请输入商户支付证书序列号" />
						</li>
					</template>
				</ListItem> -->
				
				<ListItem>
					<ListItemMeta title="商户支付密钥3版本" />
					<template #action>
						<li style="width: 100%;">
							<Input v-model="setting.zfv3apikey" placeholder="请输入商户支付密钥3版本" />
						</li>
					</template>
				</ListItem>
				
				<ListItem>
					<ListItemMeta title="商户支付私钥" />
					<template #action>
						<li style="width: 100%;">
							<Input v-model="setting.zfsy" :rows="5" type="textarea" placeholder="请输入商户支付私钥" />
						</li>
					</template>
				</ListItem>
			</List>
			<div class="button-container right">
				<Button @click="saveShxx">保存</Button>
			</div>
		</form>
	</div>
</template>
<script>
	export default {
		data() {
			return {
				setting: {
					zsxlh: null,
					zfsy: null,
					zfv3apikey: null
				}
			}
		},
		methods: {
			saveShxx() {
				this.http.post({
					url: "/settings/xtsz/info",
					data: this.setting,
				}).then(response => {
					if (response.saveMsg) {
						this.message.info("保存成功");
					}
				});
			}
		},
		created: function() {
			this.http.get({
				url: "/settings/xtsz",
			}).then(data => {
				this.setting = data.xtsz;
			});
		}
	}
</script>
